<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>事件绑定</title>
	</head>
	<body>
		<div id="app">
			展现数据:{{num}}<br />
			<!-- 事件绑定的语法:
					v-on:click="简单的计算"
					v-on:click="点击事件" -->
			<button @click="num++">+1</button>
			<button @click="addnum">+1函数</button>
			<button @click="num--">-1</button> 
			<button @click="reset">归零</button>
		</div>
		 <script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
		 <script>
			const app = new Vue({
				el : "#app",
				data : {
					num : 100
				},
				methods:{
					addnum(){
						this.num ++
					},
					reset(){
						this.num = 0
					}
					// addnum: function(){
					// 	this.num ++
					// },
					// reset:function(){
					// 	this.num = 0
					// }
				}
			})
		 </script>
	</body>
</html>
